<%@page pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>

<c:import url="/layout.jsp">
	<c:param name="title" value="Blog(Slim3)"/>
	<c:param name="content">
		<script type="text/javascript" src="this.js"></script>
		<a href="${f:url('create')}">Create</a>
		<table>
			<thead>
				<tr>
					<th>Title</th>
					<th>Content</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="e" items="${blogList}">
					<tr>
						<td>${f:h(e.title)}</td>
						<td>${f:br(f:nbsp(f:h(e.content)))}</td>
						<c:set var="editUrl" value="edit/${f:h(e.key)}/${e.version}"/>
						<c:set var="deleteUrl" value="delete/${f:h(e.key)}/${e.version}"/>
						<td><a href="${f:url(editUrl)}">Edit</a></td>
						<td><a href="${f:url(deleteUrl)}" onclick="return confirm('delete OK?')">Delete</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</c:param>
</c:import>
